var registration = {
    name: '',
    alias: '',
    imageUrl: '',
    gender: '',
    ethnic: '',
    birthday: '',
    height: '',
    idNumber: '',
    phone: '',
    physicalConditions: '',
    education: '',
    employer: '',
    residencePolice: '',
    residentPolice: '',
    residenceDetail: '',
    residentDetail: '',
    employmentStatus: '',
    drugTypes: '',
    seizedDate: '',
    seizedUnits: '',
    seizedPlace: '',
    natureCase: '',
    rehabilitationPeriod: '',
    checkInTime: '',
    drugAbuseTime: '',
    registerPerson: '',
    registerUnits: '',
    remarks: '',
    illegalFacts: '',
    drugRehabilitation: '',
    enclosureUrl: ''
}

data = {id: ''}

function getInputValues(urlObj) {
    registration.name = $("input[name='xing-ming']").val();
    registration.alias = $("input[name='bie-ming']").val();
    registration.gender = $("input[name='sex']").val();
    registration.imageUrl = urlObj.avatarUrl;
    registration.ethnic = $("input[name='min-zu']").val();
    registration.birthday = $("input[name='birthday']").val();
    registration.height = $("input[name='shen-gao']").val();
    registration.idNumber = $("input[name='id-number']").val();
    registration.phone = $("input[name='tel-phone']").val();
    registration.physicalConditions = $("input[name='shen-ti']").val();
    registration.education = $("input[name='culture-degree']").val();
    registration.employer = $("input[name='work-address']").val();
    registration.residencePolice = $("input[name='hjdpcs']").val();
    registration.residenceDetail = $("input[name='hjdxz']").val();
    registration.residentPolice = $("input[name='jzdpcs']").val();
    registration.residentDetail = $("input[name='jzdxz']").val();
    registration.employmentStatus = $("input[name='jyqk']").val();
    registration.drugTypes = $("input[name='drug-type']").val();
    registration.seizedDate = $("input[name='seizure-date']").val();
    registration.seizedUnits = $("input[name='seizure-unit']").val();
    registration.seizedPlace = $("input[name='location-seizure']").val();
    registration.natureCase = $("input[name='nature-case']").val();
    registration.illegalFacts = $("input[name='fact-malfeasance']").val();
    registration.drugRehabilitation = $("input[name='abandon-drug']").val();
    registration.rehabilitationPeriod = $("input[name='abandon-date']").val();
    registration.checkInTime = $("input[name='register-time']").val();
    registration.drugAbuseTime = $("input[name='drug-date']").val();
    registration.registerPerson = $("input[name='register-person']").val();
    registration.registerUnits = $("input[name='register-unit']").val();
    registration.remarks = $("input[name='remarks']").val();
    registration.enclosureUrl = urlObj.enclosureUrl;
    return registration;
}

function setInputValues(registration){

    $("input[name='xing-ming']").val(registration.name);
    $("input[name='bie-ming']").val(registration.alias);
    $("input[name='sex']").val(registration.gender);
    $('#avatarUrl').hide();
    $('#avatarImage').attr('src',registration.imageUrl);
    $("input[name='min-zu']").val(registration.ethnic );
    $("input[name='birthday']").val(registration.birthday);
    $("input[name='shen-gao']").val(registration.height);
    $("input[name='id-number']").val(registration.idNumber);
    $("input[name='tel-phone']").val(registration.phone);
    $("input[name='shen-ti']").val(registration.physicalConditions);
    $("input[name='culture-degree']").val(registration.education);
    $("input[name='work-address']").val(registration.employer);
    $("input[name='hjdpcs']").val(registration.residencePolice);
    $("input[name='hjdxz']").val(registration.residenceDetail);
    $("input[name='jzdpcs']").val(registration.residentPolice);
    $("input[name='jzdxz']").val(registration.residentDetail);
    $("input[name='jyqk']").val(registration.employmentStatus);
    $("input[name='drug-type']").val(registration.drugTypes);
    $("input[name='seizure-date']").val(registration.seizedDate);
     $("input[name='seizure-unit']").val(registration.seizedUnits);
     $("input[name='location-seizure']").val(registration.seizedPlace);
     $("input[name='nature-case']").val(registration.natureCase);
     $("input[name='fact-malfeasance']").val(registration.illegalFacts);
     $("input[name='abandon-drug']").val(registration.drugRehabilitation);
     $("input[name='abandon-date']").val(registration.rehabilitationPeriod);
     $("input[name='register-time']").val(registration.checkInTime);
    $("input[name='drug-date']").val(registration.drugAbuseTime);
     $("input[name='register-person']").val(registration.registerPerson);
     $("input[name='register-unit']").val(registration.registerUnits);
     $("input[name='remarks']").val(registration.remarks);
     $("#file").hide();

}
